import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

let cName='';
if(!localStorage.getItem('cName')){
	localStorage.setItem('cName','北京')
}else{
	cName=localStorage.getItem('cName')
}

const state={
	cityName:cName
}

const mutations={
	commitCity(state,itemName){
		state.cityName=itemName;
		localStorage.setItem('cName',itemName)
	}
}
export default new Vuex.Store({
   state,
   mutations,
})